#!/usr/bin/python
# -*- coding: utf-8 -*-

""" 測試類別 """

import datetime



class C(object):
	""" 測試用類別 C """

	def __init__(self, v, *args, **kwds):
		super(C, self).__init__(*args, **kwds)
		self.v = v
		print "C init-ed with v=%r" % (v,)
	# ### def __init__

	def p(self, other_v):
		return self.v + other_v
	# ### def p

	def m(self, other_v):
		return self.v * other_v
	# ### def m

	def __str__(self):
		return "C: v=%r" % (self.v,)
	# ### def __str__

	def __repr__(self):
		return "%s.C(%r)" % (__name__, self.v,)
	# ### def __repr__
# ### class C


class D(C):
	""" 測試用類別 D """

	def __init__(self, w, *args, **kwds):
		super(D, self).__init__(*args, **kwds)
		self.w = w
		print "D init-ed with w=%r" % (w,)
	# ### def __init__

	def m(self, other_v):
		return self.v * self.w * other_v
	# ### def m

	def __str__(self):
		return "D: w=%r" % (self.w,)
	# ### def __str__

	def __repr__(self):
		return "%s.D(%r, %r)" % (__name__, self.w, self.v,)
	# ### def __repr__
# ### class D



obj = D(2, 3)
dt = datetime.datetime.now()


print "obj.p(5) =", obj.p(5)
print "obj.m(5) =", obj.m(5)



# vim: ts=4 sw=4 foldmethod=marker ai nowrap
